package util;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class PlayBloodAudio extends PlayAudio implements Runnable {

    @Override
    public void run() {
        try {
            if (audioFile != null) {
                BufferedInputStream audio = new BufferedInputStream(new FileInputStream(audioFile));
                player = new Player(audio);
                player.play();
            }
        } catch (FileNotFoundException | JavaLayerException e) {
            e.printStackTrace();
        }
    }
}
